
import util from "../../common/js/util.js";

const baseData = {
  startDate: "",
  endDate: "",
  TYPE: ""
};

Page({

  data: {
    isShow: false,
    startDate: '',
    endDate: "",
    TYPE: "",//"" 全部 1 日报  2周报
    values: [],
    data: Object.assign({}, baseData),
    active:"",
    isShowNo:false
  },
  // props: {
  //   data_start: "",
  // 	data_end:  "",
  //   data_type: "",
  //   onQueryFilter: function onQueryFilter() { }
  // },
  onLoad(e) {
    let targetDate= util.getDateByString("2023-02-01 00:00:00");
    let currentDate= new Date();
    let isShowNo= util.compareDate(currentDate,targetDate);
    //console.log(e.active);
    this.setData({
      active:e.active,
      isShowNo
    })
    // this.startDate = this.getDate("start");
    // this.endDate = this.getDate("endDate");
  },
  close() {
    this.isShow = false;

    this.TYPE = [];
    Object.assign(this.data, baseData);
    // debugger
    this.$emit("chooseTemplate", this.data);

  },
  choose(e) {
    let type=e.currentTarget.dataset.type;
    // console.log(type);
    // uni.reLaunch({
		// 			url: `/pages/Write_Journal/Write_Journal?url=/pages/entering_Diary_Item/entering_Diary_Item&action=add&_TYPE=${this._TYPE}&active=${this.active}`
    // });
    dd.navigateTo({
       url: `../Write_Journal/Write_Journal?action=add&_TYPE=${type}&active=${this.data.active}`
    })
  }
});
